<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link type="text/css" rel="stylesheet" href="main.css">
    <title>发布航行警（通）告</title>
    
	<!--jquery -->
	<script type="text/javascript" src="../js/jquery/jquery-2.0.3.min.js" ></script>
	
	<script type="text/javascript" src="../js/share.js"></script>
	
	<script type="text/javascript">
	
	var itemno = "";
	var applyid = "";
	var nodeno = "";
	var orgcode = "";
	var nextnodecode1 = "";
	var selectID = "userlist";
	var applyno = "";

	$(function(){
		applyno = getUrlParam("applyno");
		bindApply(applyno);
	})


	function bindApply(applyno){
		$.ajax({ 
			url: basePath() + 'business/getapplyinfo.do',
			data: {"applyno": applyno},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonApply = data.datas;
		    		
		    		bindApplyForm(jsonApply);
		    		
		    		//绑定业务资料
		    		bindBusinessForm(jsonApply['applyid'], jsonApply['itemno']);
		    		
		    		//绑定附件材料
		    		// bindMaterialListForm(jsonApply['applyid']);	 

		    	}
	      	}
		});
	}

	function bindApplyForm(jsonApply){
		$('#workname').html(jsonApply['itemname'].substring(0, jsonApply['itemname'].length-4));
		for(var d in jsonApply){//遍历json对象的每个key/value对,p为key
			if(d == 'applytime'){
				$('#' + d).html(formatDate(jsonApply[d], 'yyyy年mm月dd日'));
			} else{
				$('#' + d).html(jsonApply[d] == '' ? '/' : jsonApply[d]);
			}
		}
	}

	function bindBusinessForm(applyid, itemno){

		$.ajax({ 
			url: basePath() + 'business/getbusinessinfo.do',
			data: {"applyid": applyid, "itemno": itemno},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonBusiness = data.datas;
					if(itemno == '1005'){
						$('#worktime').html(formatDate(jsonBusiness['workbegintime'], 'yyyy年mm月dd日') + '——' + formatDate(jsonBusiness['workendtime'], 'yyyy年mm月dd日'));
						//绑定设备及主要技术参数
						bindDevice(applyid, jsonBusiness['workunitname']);
						// $('#workunitname').html();
						var s = jsonBusiness['waterwayname'] + ',' + jsonBusiness['navigationmarkname'] + ',' + jsonBusiness['workarea'];
						$('#workarea').html(s);
						$('#emergentstep').html(jsonBusiness['emergentstep']);
		    		} else if (itemno == '1006'){
						$('#worktime').html(formatDate(jsonBusiness['worktime'], 'yyyy年mm月dd日'));
						var htmlStr = '<table border="0" style="border-width:0 " align="left">' +
											'<tr>' +
												'<td style="text-align: left;"><p style=" margin-left: 10px;margin-top:-2px;word-break: break-all;"> 拖船名称：'+ jsonBusiness['workshipname'] +'</p></td>' +
											'</tr>' +
											'<tr>' +
												'<td style="text-align: left;"><p style=" margin-left: 10px;margin-top:-2px;word-break: break-all;"> 被拖设施或平台名称：'+ jsonBusiness['towingname'] +'</p></td>' +
											'</tr>' +
											'<tr>' +
												'<td style="text-align: left;"><p style=" margin-left: 10px;margin-top:-2px"> 拖带长度（米）：'+ jsonBusiness['towinglength'] +'</p></td>' +
											'</tr>' +
									'</table>';
						$('#tableD').html(htmlStr);
						$('#workarea').html(jsonBusiness['towingcontent']);
						$('#usesignal').html(jsonBusiness['usesignal']);
					}
		    	}
	      	}
		});
	}

	function bindMaterialListForm(applyid){

		$.ajax({ 
			url: basePath() + 'business/getmaterialinfo.do',
			data: {"applyid": applyid},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonMaterial = data.datas;

					var k = 1;
					for(var i = 0; i < jsonMaterial.length; i++){
						var materialname = jsonMaterial[i]['materialname'];
						
						var fileid=jsonMaterial[i]['fileid']
						if('' != fileid){
							var materialnameHmtl = k + '、' + materialname + '<br />';
							$('#material').append(materialnameHmtl);
							k++;
						}
					}
		    	}
	      	}
		});
	}

	function bindDevice(applyid, name){
		$.ajax({ 
			url: basePath() + 'business/getshipinfo.do?applyid='+applyid,
			dataType: "json",
			success: function(data){
				var shipname = '';
		    	if(data.result == 1){
		    		var jsonDevice = data.datas;
					for(var i = 0; i < jsonDevice.length; i++){
						shipname += jsonDevice[i]['shipname'] + "、";
					}
					// $("#shipname").html(shipname.substring(0, shipname.length-1));
		    	}
				var htmlStr = '<table border="0" style="border-width:0 " align="left">' +
									'<tr>' +
										'<td style="text-align: left;" ><p id="shipname" style=" margin-left: 10px;margin-top:-2px;word-break: break-all;"> 船舶名称：'+ shipname.substring(0, shipname.length-1) +'</p></td>' +
									'</tr>' +
									'<tr>' +
										'<td style="text-align: left;"><p id="workunitname" style=" margin-left: 10px;margin-top:-2px;word-break: break-all;"> 单位名称：'+ name +'</p></td>' +
									'</tr>' +
							'</table>';
				$('#tableD').html(htmlStr);
	      	}
		});
	}
	</script>
	<style>
		.td-1{
		    text-align:center;
		    width:150px;
		    height:80px;
		    font-size: 16px;
			line-height: 40px;
		}
		.td-2{
		    width:650px;
		    height:80px;
		    font-size: 16px;
		}
	</style>
</head>
<body>
<div style="height: 300px;"></div>
<p align="center" style="font-size: 40px;font-family: 'Adobe 宋体 Std L';font-weight:bold;">中华人民共和国海事局</p>
<p align="center"  style="font-size: 30px;font-family: 'Adobe 宋体 Std L';font-weight:bold;margin-top: 50px;">发布航行警（通）告</p>
<p align="center"  style="font-size: 50px;font-family:'Adobe 黑体 Std R';font-weight:bold;margin-top: 180px;">申 请 书</p>
<p align="center"  style="font-size: 18px;font-family:'Adobe 宋体 Std L';margin-top: 150px;">中华人民共和国海事局印制</p>
<div style="height: 300px;"></div>
<h2 align="center" style="font-family:'Adobe 黑体 Std R';font-weight:bold;margin-top: 100px">注意事项</h2>
<table border="0"  align="center" cellspacing="0" cellpadding="0">
    <tr style="align-content: center; font-size: 20px;">
        <td style="border-color: transparent; width:709px;">
            <ul>
                <li style="list-style: none;">一、申请人应使用钢笔，认真、如实、准确填写申请书所列各项内容。</li>
                <li style="list-style: none;">二、申请人应按规定递交有效的船舶证书和其他需提供的资料。</li>
                <li style="list-style: none;">三、填写说明：
                    <ol>
                        <li>“作业内容和作业方式”是指从事任何类型的作业（如拖带、设置航标等）及施工作业所采取的方式。</li>
                        <li>“作业起始日期和每天作业时间”是指施工作业实际开始、预计结束的日期和每天作业的起止时间。从事拖带作业的应在此栏中写清起拖时间和预计到达下一辖区的时间及到达目的港的时间</li>
                        <li>“参加作业船舶、设施和单位名称”是指参加本次作业的船舶、设施和参加作业单位的名称。拖带作业应在此栏填写拖船、被拖船或者被拖物的名称、拖带总长度、航速。</li>
                        <li>“作业区域”在海上是因用经纬度表示。拖带作业应在此栏填写启拖位置、终点位置及主要转向点位置。</li>
                        <li>“所挂信号”是指本次作业按规定需要悬挂的信号。</li>
                        <li>“安全措施”是指作业中为防止污染和意外事故所采取的措施，包括一旦发生污染和意外事故时的应急处置行动。</li>
                    </ol>
                </li>
                <li style="list-style: none;">四、申请作业项目、地点、范围、作业船舶等发生变更，原申请人须重新办理申请手续。</li>
                <li style="list-style: none;">五、本申请书一式二份，批准后分别由批准机关和申请人保存。</li>
                <li style="list-style: none;">六、同一作业重新办理申请，或作业被取消，或申请人的作业资格被取消时，原申请书均不退还申请人。</li>
            </ul>
        </td>
    </tr>
</table>
<div style="height: 300px;"></div>
<div style="height: 1280px;">
	<table border="1"  align="center" cellspacing="0" cellpadding="0" style="border-style: solid;border-width: 1px;border-color: black;border-collapse: collapse; " >
		<thead>
			<tr>
				<th class="td-1">申请内容</th>
				<th class="td-2">详细情况</th>
			</tr>
		</thead>
		<tr>
			<td class="td-1">作业内容</td>
			<td class="td-2" style="text-align: left;">
				&nbsp;
				<span id="workname"></span>
			</td>
		</tr>
		<tr>
			<td class="td-1">作业起止时间和<br/>每天工作时间</td>
			<td class="td-2" style="text-align: left;">
				<table  border="0" style="border-width:0 " align="left">
					<tr>
						<td style="height:40px;text-align: left;" ><p id="worktime" style=" margin-left: 10px;margin-bottom:-2px"></p></td>
					</tr>
					<tr>
						<td style="height:40px;text-align: left;"><p id="dailytime" style=" margin-left: 10px;margin-top:-2px"></p></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td class="td-1" style="height:150px;">参加作业的船舶、<br/>设施和单位名称</td>
			<td class="td-2" id="tableD" style="text-align: left;">
			</td>
		</tr>
		<tr>
			<td class="td-1" style="height: 300px;">作业区域</td>
			<td class="td-2" style="text-align: left;">
				&nbsp;&nbsp;<span id="workarea"></span>
			</td>
		</tr>
		<tr>
			<td class="td-1">所挂信号</td>
			<td class="td-2" style="text-align: left;">
				&nbsp;&nbsp;<span id="usesignal"></span>
			</td>
		</tr>
		<tr>
			<td class="td-1" style="height: 150px;">安全措施</td>
			<td class="td-2" style="text-align: left; margin-left: 5px;">
				&nbsp;&nbsp;<span id="emergentstep"></span>
			</td>
		</tr>
	 </table>
	 <table border="0"  align="center" cellspacing="0" cellpadding="0" style="width: 800px;">
		<tr>
			<td >
				<div style="margin-left: 20px;">
					<p>申请单位名称（盖章）：</p>
					<p>申请时间：<span id="applytime">2018年6月15日</span></p>
					<p>联系人：<span id="proposer">小吴</span> &nbsp;&nbsp;地址：<span id="contactaddr">深圳市南山区街道月亮湾山庄C区90栋</span></p>
					<p>电话：<span id="mobilephone">18512365656</span id="email"> &nbsp;&nbsp;E-mail：<span id="email">897456321@qq.com</span></p>
				</div>
			</td>
		</tr>
	 </table>
 </div>

<div style="height: 1280px;">
	<table border="1" align="center" height="90%" cellspacing="0" cellpadding="0" style="margin-top: 50px;border-style: solid;border-width: 1px;border-color: black;border-collapse: collapse;width: 800px;">
		<tr>
			<td style="height: 50%;text-align:center;width:50px;">管<br/>理<br/>部<br/>门<br/>的<br/>处<br/>理<br/>意<br/>见</td>
			<td style="width: 90%">
			</td>
		</tr>
		<tr>
			<td style="height: 50%;text-align:center;width:50px;">领<br/>导<br/>的<br/>审<br/>批<br/>意<br/>见</td>
			<td style="width: 90%">
			</td>
		 </tr>
	</table>
 </div>
</body>
</html>